// 组织架构的接口
import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 删除组织架构的部门
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 新增部门
export function addDepartment(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data // axios的body参数data
  })
}
// 获取部门信息
export function getDeparDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 保存编辑的数据
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
